#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "FreeRTOS.h"
#include "task.h"
#include "system_LPC17xx.h"
#include "GLCD.h"
#include "vtUtilities.h"
#include "LCDtask.h"
#include "string.h"
#include "math.h"
#include "lpc17xx_uart.h"
#include "lpc17xx_pinsel.h"
#include "lpc17xx_libcfg_default.h"
#include "CommsDefs.h"
#include "UartTask.h"
#include "CommandThread.h"

//#define CMDSlightLeftL 0x28
//#define CMDSlightRightL 0x50
//#define CMDStraightL 0x48
//#define CMDStopL 0x40
//#define CMDTurnLeftL 0x28
//#define CMDTurnRightL 0x50
//#define CMDReverseL 0x20
//
//#define CMDSlightLeftR 0xD0
//#define CMDSlightRightR 0xA8
//#define CMDStraightR 0xC8
//#define CMDStopR  0xC0
//#define CMDTurnLeftR 0xD0
//#define CMDTurnRightR 0xA8
//#define CMDReverseR 0xA0

void Init_CollisionThread();
//void CollisionThreadTaskCode();

Comms_Msg_Struct msg;

Msg_Type_Enum msgType;

Collision_Data_Enum collisionData;




Collision_Data_Enum Control_Straight();

Collision_Data_Enum Control_SlightLeft();

Collision_Data_Enum Control_SlightRight();

Collision_Data_Enum Control_TurnLeft();

Collision_Data_Enum Control_TurnRight();
unsigned int IsValid(unsigned int Sensor_value, unsigned int TH);





